/*
 * @Description: 单位导航包裹组件
 * @Author: Rfan
 * @Date: 2022-03-08 15:54:50
 * @LastEditTime: 2022-12-30 10:03:23
 */

import { useOpeningRouterTypeContext } from '../contexts/OpeningRouterTypeContext';
import { useOpeningContext } from '../contexts/OpeningContext';
import UFALNav from '@/components/UFALNav';

const NavSidebar = () => {
  const { routerType } = useOpeningRouterTypeContext();
  const { setSelectFond, setSelectAT, setSelectLevel } = useOpeningContext();

  const handleNavChange = ({ fondItem, atItem, levelItem }: any) => {
    setSelectFond(fondItem);
    setSelectAT(atItem);
    setSelectLevel(levelItem);
  };

  return (
    <>
      <UFALNav type={routerType} hideLowest={false} onChange={handleNavChange} />
    </>
  );
};

export default NavSidebar;
